/**
 * jims
 */
package com.jims.master.modules.sys.service;

import com.jims.master.common.persistence.Page;
import com.jims.master.common.service.CrudService;
import com.jims.master.modules.sys.dao.SysLoggerDao;
import com.jims.master.modules.sys.entity.SysLogger;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 登录用户信息记录Service
 * @author WangYQ
 * @version 2017-08-04
 */
@Service
@Transactional(readOnly = true)
public class SysLoggerService extends CrudService<SysLoggerDao, SysLogger> {

	@Override
    public SysLogger get(String id) {
		return super.get(id);
	}
	
	@Override
    public List<SysLogger> findList(SysLogger sysLogger) {
		return super.findList(sysLogger);
	}
	
	@Override
    public Page<SysLogger> findPage(Page<SysLogger> page, SysLogger sysLogger) {
		sysLogger.setPage(page);
		page.setList(this.dao.findAllList(sysLogger));
		return page;
	}
	
	@Override
    @Transactional(readOnly = false)
	public int save(SysLogger sysLogger) {
		return super.save(sysLogger);
	}
	
	@Override
    @Transactional(readOnly = false)
	public int delete(SysLogger sysLogger) {
		return super.delete(sysLogger);
	}

	public Page<SysLogger> findSysLogger(Page<SysLogger> page, SysLogger sysLogger) {
		// 设置分页参数
		sysLogger.setPage(page);
		// 执行分页查询
		page.setList(this.dao.findAllList(sysLogger));
		return page;
	}

	/**
	 * 日活量统计
	 * @param sysLogger
	 * @return
	 */
	public int longerNum(SysLogger sysLogger){
		return dao.longerNum(sysLogger);
	}
}